package com.bing.task.google;

import com.bing.utils.PingTool;

import java.net.InetSocketAddress;
import java.util.concurrent.Callable;

/**
 * Created by kaibb on 15-11-25.
 */
public class SearchIP implements Callable<InetSocketAddress> {

    private InetSocketAddress address;

    public SearchIP(InetSocketAddress address) {
        this.address = address;
    }

    @Override
    public InetSocketAddress call() throws Exception {

        boolean connected = PingTool.ping(address);
        if (connected) {
            return address;
        }
        return null;
    }
}
